﻿// -----------------------------------------------------------------------
// <copyright file="PushOutcome.cs" company="Zen Design Corp">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Zen.BlackBerry.Push
{
	using System;
	using Zen.BlackBerry.Common;
	using Zen.BlackBerry.Pap;

	/// <summary>
	/// The outcome of a push request for a particular address.
	/// </summary>
	public class PushOutcome
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="PushOutcome"/> class.
		/// </summary>
		/// <param name="address">The address.</param>
		/// <param name="code">The code.</param>
		/// <param name="description">The description.</param>
		/// <param name="eventTime">The event time.</param>
		/// <param name="messageState">State of the message.</param>
		/// <param name="applicationReliable">
		/// if set to <c>true</c> the application is reliable; otherwise
		/// <c>false</c>.</param>
		public PushOutcome(
			string address,
			StatusCode code,
			string description,
			DateTime? eventTime,
			MessageState messageState,
			bool applicationReliable)
		{
			Address = address;
			Code = code;
			Description = description;
			EventTime = eventTime;
			MessageState = messageState;
			IsApplicationReliable = applicationReliable;
		}

		/// <summary>
		/// Gets the address associated with the outcome.
		/// </summary>
		/// <value>The address.</value>
		public string Address
		{
			get;
			private set;
		}

		/// <summary>
		/// Gets the code.
		/// </summary>
		/// <value>The code.</value>
		public StatusCode Code
		{
			get;
			private set;
		}

		/// <summary>
		/// Gets the description.
		/// </summary>
		/// <value>The description.</value>
		public string Description
		{
			get;
			private set;
		}

		/// <summary>
		/// Gets the date at which the outcome was decided.
		/// </summary>
		/// <value>The event time.</value>
		public DateTime? EventTime
		{
			get;
			private set;
		}

		/// <summary>
		/// Gets the state of the request.
		/// </summary>
		/// <value>The state of the message.</value>
		public MessageState MessageState
		{
			get;
			private set;
		}

		/// <summary>
		/// Gets a value indicating whether the delivery method of the request
		/// was application-level reliable.
		/// </summary>
		/// <value>
		/// <c>true</c> if the delivery method of the request was application-
		/// level reliable; otherwise, <c>false</c>.
		/// </value>
		public bool IsApplicationReliable
		{
			get;
			private set;
		}
	}
}
